package 刷题10月.位运算;
// https://www.nowcoder.com/practice/8ee967e43c2c4ec193b040ea7fbb10b8?tpId=13&tqId=23273&ru=/ta/sql-quick-study&qru=/ta/sql-quick-study/question-ranking
public class JZ11二进制中1的个数1003 {
    public class Solution {
        public int NumberOf1(int n) {
            int num = 0;
            while (n != 0) {
                num++;
                n &= (n - 1);
            }
            return num;
        }
    }
}
